<?php
/**
 * Configures the current validator.
 *
 * Available options:
 *
 *  * type: Type of value allowed
 *
 *
 * Available error codes:
 *
 *  *Type
 *  *Invalid
 *
 * @param array $options   An array of options
 * @param array $messages  An array of error messages
 *
 * @see sfValidatorBase
 */
class sfValidatorClearFormat extends sfValidatorBase
{
	protected function configure($options = array(), $messages = array())
	{
		$this->addMessage('type','Type is invalid');
		$this->addOption('type');
	}

	/**
	 * @see sfValidatorBase
	 */
	protected function doClean($value)
	{
		$clean = preg_replace('/[^0-9]/', '', $value);
		return $clean;
	}
}